package com.tensquare.base.controller;

import entity.Result;
import entity.StatusCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @ClassName BaseExceptionHandler
 * @Description TODO
 * @Author zhangshuai
 * @Date 2019/1/12 19:22
 * @Version 1.0
 **/
@ControllerAdvice
public class BaseExceptionHandler {


    @ExceptionHandler(value = Exception.class)
    public Result exception(Exception e) {
        return new Result(false, StatusCode.ERROR, e.getMessage());
    }

}
